package com.eims.sls_app.ui;

import java.util.List;

import com.eims.sls_app.dataaccess.FollowsBean;
import com.eims.sls_app.ui.adapter.WithdetailsAdapter;

import bls.juejin.cn.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.ListView;
import android.widget.TextView;

public class WithdetailsActivity extends MyBaseActivity implements OnClickListener {
	private ListView lv2_details;
	private List<FollowsBean> followsBeans;
	private WithdetailsAdapter adapter;
	private TextView tv_details_title;
	private ImageButton btn_back_with;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_with_details);
		
		initView();
	}

	@SuppressWarnings("unchecked")
	private void initView() {
		followsBeans = (List<FollowsBean>) getIntent().getSerializableExtra("details");
		lv2_details = (ListView) findViewById(R.id.lv2_details);
		tv_details_title = (TextView) findViewById(R.id.tv_copy_list);
		btn_back_with = (ImageButton) findViewById(R.id.btn_back_with);
		if (followsBeans.size()>10){
			adapter = new WithdetailsAdapter(followsBeans.subList(0,10),this);

		}else {
			adapter = new WithdetailsAdapter(followsBeans,this);
		}

		lv2_details.setAdapter(adapter);
		tv_details_title.setText("跟单列表("+followsBeans.size()+")");
		btn_back_with.setOnClickListener(this);
	}

	@Override
	public void onClick(View view) {
		switch (view.getId()) {
		case R.id.btn_back_with:
			finish();
			break;

		default:
			break;
		}
		
	}

}
